<?php
$rs_groups = groupList(39);
$row_rs_groups = mysql_fetch_assoc($rs_groups);
$groupResult =  groupMemberDetail($_GET["itemid"]);
$group = mysql_fetch_assoc($groupResult);

?>

<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
  <table align="center">
    <tr valign="baseline">
      <td align="right" valign="top" nowrap="nowrap">Group:</td>
      <td><select name="group_id">
        <?php
do {
?>
              <option value="<?php echo $row_rs_groups['category_id']?>" <?php if($group["group_id"]==$row_rs_groups['category_id'])        echo ' selected=\'selected\'';?>><?php echo $row_rs_groups['category_name']?></option>
        <?php
} while ($row_rs_groups = mysql_fetch_assoc($rs_groups));
?>
      </select></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr valign="baseline">
      <td align="right" valign="top" nowrap="nowrap">Page:</td>
      <td><input type="text" id="groupPageId" name="content" value="<?php echo $group["content_id"];?>" size="32"  onkeyup="getData('pages/searchrelatedpage.php?aj&c=content_id&check=<?php echo $group["content_id"]; ?>&rel='+this.value,'content_search');"/><div id="content_search"></div></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr valign="baseline">
      <td align="right" valign="top" nowrap="nowrap">Group member title:</td>
      <td><input type="text" name="group_member_title" value="<?php echo $group["group_member_title"];?>" size="32" /></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr valign="baseline">
      <td align="right" valign="top" nowrap="nowrap">Group order:</td>
      <td><input type="text" name="group_order" value="<?php echo $group["group_order"];?>" size="32" />
        [0-etc]</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right" valign="top">Description:</td>
      <td><textarea name="description" cols="50" rows="5"><?php echo $group["description"];?></textarea></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr valign="baseline">
      <td align="right" valign="top" nowrap="nowrap">Group direct link:</td>
      <td><input type="text" name="group_direct_link" value="<?php echo $group["group_direct_link"];?>" size="32" />
        [leave blank if none exist]</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr valign="baseline">
      <td align="right" valign="top" nowrap="nowrap">Group member resource:</td>
      <td>
          <?php $res = getResourceDetails($group["group_member_resource"]);
                $resource = mysql_fetch_assoc($res);
          ?>
          <a href="../resources/<?php echo  $resource["resource_url"]; ?>" rel="facebox" title="<?php echo  $resource["resource_description"]; ?>" > <img name="" src="../resources/thump.php?im=<?php echo  $resource["resource_url"]; ?>" alt="" /></a>

      <?php $radioBtnName="group_member_resource";$checked = $group["group_member_resource"];
                include("images.php");
          ?></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr valign="baseline">
      <td align="right" valign="top" nowrap="nowrap">&nbsp;</td>
      <td><input type="submit" value="Add Group Member" /></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
  <input type="hidden" name="MM_insert" value="groupEditFrm" />
   <input type="hidden" name="group_member_id" value="<?php echo $group["group_member_id"];?>" />
</form>
<p>&nbsp;</p>
<script type="text/javascript">
    val = document.getElementById("groupPageId").value;
    if(val.length>0)
getData('pages/searchrelatedpage.php?aj&c=content_id&check='+val+'&rel='+val,'content_search');
</script>